package 设计模式.行为模式.模板模式.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import 设计模式.行为模式.模板模式.*;

/**
 * @author lchenglong
 * @date 2024/1/26
 */
@Service
public class GestureLoginServiceImpl extends LoginTemplate {
    @Autowired
    public GestureLoginServiceImpl(UserDao userDao) {
        super(userDao);
    }

    @Override
    public LoginTypeEnum getType() {
        return LoginTypeEnum.GESTURE;
    }

    @Override
    public Result doLogin(UserInfo userInfo, String gesture) {
        //验手势密码是否正确
        if(!userInfo.getGesture().equals(gesture)){
            return new Result("004","手势密码错误",null);
        }else{
            return new Result("200","登录成功",null);
        }
    }
}
